Batch confirm members#549
Open
georgelgeback wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “pre-registration member” entity and admin API endpoints for managing known members (by email/stil-id/telephone) before they register on the site, plus centralizes and strengthens stil-id validation.
Changes:
- Introduces
PreregMember_DB+ Pydantic schemas and a new/prereg-membersrouter with CRUD + batch endpoints. - Adds test coverage for prereg-member routes and for invalid stil-id during
/auth/register. - Refactors
check_stil_idinto a shared helper and adds Pydantic-level stil-id validation in user schemas.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_users.py | Adds a registration test asserting invalid stil_id is rejected (422). |
| tests/test_prereg_members.py | Adds end-to-end tests for prereg-member CRUD and batch behavior. |
| services/user.py | Switches stil-id validation to the shared helper import. |
| routes/prereg_member_router.py | New prereg-member API router (list/get/create/batch create/update/delete + batch delete). |
| routes/init.py | Registers the prereg-member router under /prereg-members. |
| helpers/check_stil_id.py | New shared stil-id validator helper. |
| db_models/prereg_member_model.py | New prereg-member DB model + constraints. |
| api_schemas/user_schemas.py | Adds reusable stil-id validator mixin used by UserCreate/UserUpdate. |
| api_schemas/prereg_member_schema.py | New prereg-member request/response schemas. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+138
to
+139
| # Note: returns all existing prereg members that would collide unless they were skipped, not the newly created prereg members | ||
| return existing_prereg_members |
Contributor
Author
There was a problem hiding this comment.
In the frontend, we use the collision count to report collisions in a nice way back to the user. AFAIK we have never ever used returned rows to discover IDs in any part of the frontend, so I think it can be safely ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ready to be merged in!
Adds a new pre-registration member object to store email addresses, stil-id, and telephone numbers of people we know are members but who have not yet been registered as members on the website. This is really important for the frontend member admin pipeline to be as simple as possible. This does change a tiny portion of the schema of the user mangement system for better control of stil-id validation, but changes are minimal.